import type { ThinkingMCP, WorkflowRunner, ZeroDB, ZeroMCP } from './main';
import type { ZeroAgent, ZeroDriver } from './routes/agent';
import { env as _env } from 'cloudflare:workers';
import type { QueryableHandler } from 'dormroom';

export type ZeroEnv = {
  ZERO_DRIVER: DurableObjectNamespace<ZeroDriver & QueryableHandler>;
  ZERO_DB: DurableObjectNamespace<ZeroDB>;
  ZERO_AGENT: DurableObjectNamespace<ZeroAgent>;
  ZERO_MCP: DurableObjectNamespace<ZeroMCP & QueryableHandler>;
  THINKING_MCP: DurableObjectNamespace<ThinkingMCP & QueryableHandler>;
  WORKFLOW_RUNNER: DurableObjectNamespace<WorkflowRunner & QueryableHandler>;
  HYPERDRIVE: { connectionString: string };
  snoozed_emails: KVNamespace;
  gmail_sub_age: KVNamespace;
  subscribe_queue: Queue;
  AI: Ai;
  gmail_history_id: KVNamespace;
  gmail_processing_threads: KVNamespace;
  subscribed_accounts: KVNamespace;
  connection_labels: KVNamespace;
  prompts_storage: KVNamespace;
  NODE_ENV: 'local' | 'development' | 'production';
  JWT_SECRET: 'secret';
  ELEVENLABS_API_KEY: '1234567890';
  DISABLE_CALLS: 'true' | '';
  DROP_AGENT_TABLES: 'false';
  THREAD_SYNC_MAX_COUNT: '5' | '20' | '10';
  THREAD_SYNC_LOOP: 'false' | 'true';
  DISABLE_WORKFLOWS: 'true';
  AUTORAG_ID: '';
  USE_OPENAI: 'true';
  CLOUDFLARE_ACCOUNT_ID: '';
  CLOUDFLARE_API_TOKEN: '';
  BASE_URL: string;
  VITE_PUBLIC_APP_URL: string;
  DATABASE_URL: string;
  BETTER_AUTH_SECRET: string;
  BETTER_AUTH_URL: string;
  GOOGLE_CLIENT_ID: string;
  GOOGLE_CLIENT_SECRET: string;
  RESEND_API_KEY: string;
  VITE_PUBLIC_POSTHOG_KEY: string;
  VITE_PUBLIC_POSTHOG_HOST: string;
  COOKIE_DOMAIN: string;
  BETTER_AUTH_TRUSTED_ORIGINS: string;
  GITHUB_CLIENT_ID: string;
  GITHUB_CLIENT_SECRET: string;
  GOOGLE_REDIRECT_URI: string;
  GOOGLE_APPLICATION_CREDENTIALS: string;
  HISTORY_OFFSET: string;
  ZERO_CLIENT_ID: string;
  ZERO_CLIENT_SECRET: string;
  VITE_PUBLIC_BACKEND_URL: string;
  REDIS_URL: string;
  REDIS_TOKEN: string;
  OPENAI_API_KEY: string;
  BRAIN_URL: string;
  COMPOSIO_API_KEY: string;
  GROQ_API_KEY: string;
  EARLY_ACCESS_ENABLED: string;
  GOOGLE_GENERATIVE_AI_API_KEY: string;
  AUTUMN_SECRET_KEY: string;
  AI_SYSTEM_PROMPT: string;
  PERPLEXITY_API_KEY: string;
  TWILIO_ACCOUNT_SID: string;
  TWILIO_AUTH_TOKEN: string;
  TWILIO_PHONE_NUMBER: string;
  VITE_PUBLIC_ELEVENLABS_AGENT_ID: string;
  REACT_SCAN: string;
  MICROSOFT_CLIENT_ID: string;
  MICROSOFT_CLIENT_SECRET: string;
  VOICE_SECRET: string;
  ARCADE_API_KEY: string;
  OPENAI_MODEL: string;
  OPENAI_MINI_MODEL: string;
  ANTHROPIC_API_KEY: string;
  GOOGLE_S_ACCOUNT: string;
  AXIOM_API_TOKEN: string;
  AXIOM_DATASET: string;
  THREADS_BUCKET: R2Bucket;
  thread_queue: Queue;
  VECTORIZE: VectorizeIndex;
  VECTORIZE_MESSAGE: VectorizeIndex;
};

const env = _env as ZeroEnv;
export { env };
